<!--<?php
require_once template('header');
print <<<EOT
<!--右边开始-->
<div id="right">
	<div class="tabs" id="recomtabs"><a class="tab but1" href="admincp.php?module=flow_stats&action=list&per=source">来源统计</a> <a class="tab but1" href="admincp.php?module=flow_stats&action=list&per=date">日链接分析</a> <a class="tab but1" href="admincp.php?module=flow_stats&action=list&per=month" >月链接分析</a></div>
<!--
EOT;
if ($per=='source') {
print <<<EOT
-->
<!--综合统计-->
	<table class="clst" align="center" cellpadding="0" cellspacing="1">
		<tr>
			<td class="tleft">来源统计</td>
			<td class="tright">总共链接数: <span style="font-weight: bold;">$counter_total</span> IP　　
			最大链接数: <strong>$counter_max</strong> IP　　
			最小链接数: <strong>$counter_min</strong> IP　　
			昨天链接数: <span style="font-weight:bold; color:#00f;">$counter_yesterday</span> IP　　
			今天链接数: <span style="font-weight:bold; color:#f00;">$counter_now</span> IP</td>
		</tr>
	</table>
	<table cellpadding="0" cellspacing="1" class="list">
		<tr>
			<th width="30%">链接 URL</th>
			<th width="10%">链接数</th>
			<th width="50%">链接率/图表</th>
			<th width="10%">百分比</th>
		</tr>
<!--
EOT;
foreach ($log_rt as $val){
print <<<EOT
-->
		<tr >
			<td><a href="http://$val[referer]" target="_blank">$val[referer]</a></td>
			<td style="color:#f30; font-weight:bold;">$val[referer_hit]</td>
			<td><div style="float:left; width:6px; height:14px; background: url('images/admincp/gr_01.gif'); overflow: hidden;"></div>
			<div style="float:left; width:$val[rebate]%; height:14px; background: url('images/admincp/gr_02.gif'); overflow:hidden;"></div>
			<div style="float:left; width:8px; height:14px; background: url('images/admincp/gr_03.gif'); overflow:hidden;"></div></td>
			<td>$val[rebate]%</td>
		</tr>
<!--
EOT;
} print <<<EOT
-->
	</table>
	<div id="page"><span>$page_list</span></div>
<!--
EOT;
}elseif ($per=='date'){
 print <<<EOT
-->
<!--日链接分析-->
	<table class="clst" align="center" cellpadding="0" cellspacing="1">
		<tr>
			<td class="tleft">日链接分析</td>
			<td class="tright"><form name="mvmmall" action="" method="post">今天总链接数: <span style="color: #00f; font-weight:bold;">$sum_hit</span>  独立IP <span style="color: #f00; font-weight:bold;">$show_top</span> &nbsp; &nbsp; 
			 <input type="text" name="ps_day" size="29" value="$ps_day" id="start_time" ><input type="reset" value="..."
onclick="return showCalendar('ps_day', 'y-m-d');">
			<input type="image" width="54" height="18" src="images/admincp/bt_counter_search.gif" style="vertical-align:-2px;" /></form></td>
		</tr>
	</table>
	<table cellpadding="0" cellspacing="1" class="list">
		<tr>
			<th width="20%">统计时间</th>
			<th width="12%">链接数</th>
			<th width="56%">链接率/图表</th>
			<th width="12%">百分比</th>
		</tr>
<!--
EOT;
for($i=0 ; $i<24 ; $i++) {
$temp_ps = "time_hit_".sprintf("%02d",$i);
$temp_per = $list[$temp_ps] > 0 ? sprintf("%01.2f",($list[$temp_ps]/$sum_hit)*100) :0;
print <<<EOT
-->
		<tr >
			<td>$i:00 开始 ~$i:59 结束</td>
			<td style="color:#f30; font-weight:bold;">$list[$temp_ps]</td>
			<td><div style="float:left; width:6px; height:14px; background:url('images/admincp/gr_01.gif'); overflow:hidden;"></div>
<div style="float:left; width:$temp_per%; height:14px; background: url('images/admincp/gr_02.gif'); overflow: hidden;"></div>
<div style="float:left; width:8px; height:14px; background:url('images/admincp/gr_03.gif'); overflow:hidden;"></div></td>
			<td>$temp_per%</td>
		</tr>
<!--
EOT;
} print <<<EOT
-->
	</table>
<!--
EOT;
}else { print <<<EOT
-->
<!--月链接分析-->
	<table class="clst" align="center" cellpadding="0" cellspacing="1">
		<tr>
			<td class="tleft">月链接分析</td>
			<td class="tright"><form name="mvmmall" action="" method="post">本月总链接数: <span style="color: #00f; font-weight:bold;">$month_sum</span>  独立IP <span style="color: #f00; font-weight:bold;">$show_top</span> &nbsp; &nbsp; 
			<input type="text" name="ps_year" size="5" maxlength="4" value="$ps_year" class="text" style="color:#fff; background: #f00;"/> 年
			<input type="text" name="ps_months" size="3" maxlength="2" value="$ps_months" class="text" style="color: #fff; background: #f00;"/> 月
			<input type="image" width="54" height="18" src="images/admincp/bt_counter_search.gif" style="vertical-align: -2px;"/></td>
		</tr>
	</table>
	<table cellpadding="0" cellspacing="1" class="list">
		<tr>
			<th width="20%">统计时间</th>
			<th width="12%">链接数</th>
			<th width="56%">链接率/图表</th>
			<th width="12%">百分比</th>
		</tr>
<!--
EOT;
for($i=1 ; $i<=$show_tt; $i++) {
$temp_num = sprintf("%02d",$i);
$temp_ps  = $day_sum[$temp_num] ? $day_sum[$temp_num] :0;
$temp_per = $temp_ps > 0 ? sprintf("%01.2f",($temp_ps/$month_sum)*100) :0;
print <<<EOT
-->
		<tr >
			<td>$show_yy 年 $show_mm 月 $i 日</td>
			<td style="color:#f30; font-weight:bold;">$temp_ps</td>
			<td><div style="float:left; width:6px; height:14px; background:url('images/admincp/gr_01.gif'); overflow: hidden;"></div>
			<div style="float:left; width:$temp_per%; height:14px; background:url('images/admincp/gr_02.gif'); overflow:hidden;"></div>
			<div style="float:left; width:8px; height:14px; background:url('images/admincp/gr_03.gif');overflow: hidden;"></div></td>
			<td>$temp_per%</td>
		</tr>
<!--
EOT;
} print <<<EOT
-->
	</table>
<!--
EOT;
} print <<<EOT
-->
</div>
<!--
EOT;
?>-->